package com.example.test3;

import org.apache.commons.csv.CSVRecord;
import java.util.List;

public class ChangeRecord {
    public static void change(List<RegionStates> list, CSVRecord record){
        RegionStates regionStates = new RegionStates();
        regionStates.setState(record.get("Province/State"));
        regionStates.setCountry(record.get("Country/Region"));
        regionStates.setLatestTotalCases(Integer.parseInt(record.get(record.size() - 1)));
        regionStates.setDiffFromPrevDay(Integer.parseInt(record.get(record.size()-1))-Integer.parseInt(record.get(record.size()-2)));
        System.out.println(regionStates);
        list.add(regionStates);
    }
}
